<h2 class="title2">クラス内容</h2>
<?php if ($detail):?>
<div class="content">
	<?php if ($isJoined):?>
	<?php echo $this->Form->create('CancelCourse', array('url' => array('action' => 'leave', 'controller' => 'course', $course['Course']['id']), 'type' => 'get', 'id' => 'jsJoiningCourse'));?>
	<?php else:?>
	<?php echo $this->Form->create('JoiningCourse', array('url' => array('action' => 'enter', 'controller' => 'course', $course['Course']['id']), 'type' => 'get', 'id' => 'jsJoiningCourse'));?>
	<?php endif;?>
		<dl class="information">
			<dd>受講価格：<em id="price"><?php echo number_format($detail['CourseDetail']['price']);?>円</em></dd>
			<?php if ($isOwner):?>
				<dt>&nbsp;</dt>
			<?php else:?>
				<?php if ($isFull):?>
					<?php if ($isJoined):?>
					<dt><?php echo $this->Form->submit('btn_cancel_off.png', array('div' => false));?></dt>
					<?php else:?>
					<dt>申し訳ございません。<br />
							こちらのクラスは定員に達しました。</dt>
					<?php endif;?>
				<?php else:?>
				<dt><?php echo $this->Form->submit($isJoined ? 'btn_cancel_off.png' : 'btn_entry_off.gif', array('div' => false));?></dt>
				<?php endif;?>
			<?php endif;?>
			<dd>日程:</dd>
			<dt class="seperator">
				<select name="detail" id="jsDetailList">
					<?php if(isset($course['CourseDetail'])):?>
						<?php foreach ($course['CourseDetail'] as $courseDetail):?>
						<?php if (strtotime($courseDetail['opening_date']) < time()) { continue; }?>
						<option value="<?php echo $courseDetail['id'];?>" <?php if ($detail['CourseDetail']['id'] == $courseDetail['id']):?>selected="selected"<?php endif;?>>
							<?php echo $this->Time->format('m/d H:i', $courseDetail['opening_date']);?> - <?php echo $this->Time->format('H:i', $courseDetail['closing_date']);?>
						</option>
						<?php endforeach;?>
					<?php endif;?>
				</select>
<?php
$start = strtotime($detail['CourseDetail']['opening_date']);
$end = strtotime($detail['CourseDetail']['closing_date']);
?>
				<a target="_blank" href="http://www.google.com/calendar/event?action=
TEMPLATE&text=<?php echo $course['Course']['title'];?>&dates=<?php echo gmdate('Ymd\THis\Z', $start);?>/
<?php echo gmdate('Ymd\THis\Z', $end);?>&location=<?php echo $detail['CourseDetail']['place_name']?>, <?php echo $detail['CourseDetail']['address01']?>, <?php echo $detail['CourseDetail']['address02']?>
&details=<?php echo $detail['CourseDetail']['notice'];?>&trp=true&sprop=
website:http://www.adamscampus.com&sprop=name:<?php echo $course['Course']['title'];?>" class="googleCalendar">Googleカレンダーに追加　</a>
			</dt>
			<dd>その他表記事項</dd>
			<dt class="seperator"><?php echo $detail['CourseDetail']['notice'];?></dt>
			<dd>場所:</dd>
			<dt>
				<?php if ($isOwner || $isJoined || $detail['CourseDetail']['address_flg']):?>
				<?php echo $detail['CourseDetail']['address01'];?><br/>
				<?php echo $detail['CourseDetail']['address02'];?>
				<?php endif;?>&nbsp;
			</dt>
			<dd class="oneLine">エリア:&nbsp;</dd>
			<dt class="oneLine seperator"><?php echo $detail['Area']['name'];?></dt>
			<dd>このクラスの参加者：</dd>
			<dt><?php echo intval($detail['CourseCounting']['entered_counting']);?>/<?php echo $detail['CourseDetail']['attend_total'];?>席</dt>
		</dl>
	</form>
</div>
<?php else:?>
	<div class="content">
		<dl class="information">
			<dd>受講価格：<em id="price"><?php echo isset($course['Course']['price']) ? number_format($course['Course']['price']) : 0;?>円</em></dd>
			<dt><p class="noSchedule">まだ開催予定がありません。<br />
				講師による予定の追加をお待ちください。
			</p></dt>
		</dl>
	</div>
<?php endif;?>